package com.ling.pl.security.view.global;

import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;
import com.ling.core.common.utils.D7PageUtils;
import com.ling.pl.security.feign.DefaultUserService;
import com.ling.pl.security.model.DefaultUserVO;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author bo.wang
 * @since 2013-2-5
 */
@Component("ling2.userSelect")
public class UserSelect {
    @Resource
    private DefaultUserService userService;

    @DataProvider
    public void loadUsers(Page<DefaultUserVO> page, Map params) throws Exception {
        D7PageUtils.daoPageToPage(userService.findDefaultUserByPage(D7PageUtils.buildQueryParams(params, page)), page);
    }
}
